package httpserver.general;

import java.util.HashMap;

public class MIMETypes {

    public static final String MIME_HTML = "text/html";
    public static final String MIME_CSS = "text/css";
    public static final String MIME_TXT = "text/plain";
    public static final String MIME_GIF = "image/gif";
    public static final String MIME_JPG = "image/jpeg";
    public static final String MIME_PNG = "image/png";
    public static final String MIME_URL_ENCODED = "application/x-www-form-urlencoded";
    public static final String MIME_FORM_DATA = "multipart/form-data";
    public static final String MIME_BINARY = "application/octet-stream";

    private static final HashMap<String, String> types = new HashMap<String, String>(){{

        put("html", MIME_HTML);
        put("htm", MIME_HTML);
        put("txt", MIME_TXT);
        put("css", MIME_CSS);
        put("exe", MIME_BINARY);
        put("jpg", MIME_JPG);
        put("gif", MIME_GIF);
        put("png", MIME_PNG);

    };};

    public static String getType(String extention){
        return types.get(extention);
    }
}
